// token
const jwt = require('jsonwebtoken');
const { tokenSerect } = require('../config')

const addToken = (user) => { //创建token并导出
    const token = jwt.sign({
      id: user.id,
      code: user.code
    }, tokenSerect, {expiresIn: '168h'});
    return token;
  }
  module.exports = addToken